package com.it.boot.config.excel;

import lombok.Data;

// 导入结果类
@Data
public class ImportInfo {
    private boolean success;
    private int successCount;
    private int errorCount;
    private String message;
    private String errorFileUrl;

    public static ImportInfo success(int successCount, String message) {
        ImportInfo result = new ImportInfo();
        result.setSuccess(true);
        result.setSuccessCount(successCount);
        result.setMessage(message);
        return result;
    }

    public static ImportInfo fail(int successCount, int errorCount, String errorFileUrl, String message) {
        ImportInfo result = new ImportInfo();
        result.setSuccess(false);
        result.setSuccessCount(successCount);
        result.setErrorCount(errorCount);
        result.setErrorFileUrl(errorFileUrl);
        result.setMessage(message);
        return result;
    }
}
